package com.pro.service.imple;

import com.pro.mapper.CommentMapper;
import com.pro.pojo.*;
import com.pro.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @Title: 评论service实现类
* @author 许振杰
* @date 2022/1/15 0015 10:06
* @version V1.0
*/

@Service
public class CommentServiceImple implements CommentService {
    @Autowired
    private CommentMapper commentMapper;

    /**
     * @Title: 查询前端用户的全部评论
     * @author 许振杰
     * @date 2022/1/15 0015 10:57
     * @version V1.0
     */
    @Override
    public List<JsComment> getBeforeProductComment(Integer type, Integer userType) {
        return commentMapper.getBeforeProductComment(type, userType);
    }

    /**
     * @Title: 查询后台用户的全部评论
     * @author 许振杰
     * @date 2022/1/15 0015 16:23
     * @version V1.0
     */
    @Override
    public List<JsComment> getUserProductComment(Integer type, Integer userType) {
        return commentMapper.getUserProductComment(type, userType);
    }

    /**
    * @Title: 查询全部评论数量
    * @author 许振杰
    * @date 2022/1/17 0017 15:02
    * @version V1.0
    */
    @Override
    public Integer getCommentCount(Integer type, Integer userType) {
        return commentMapper.getCommentCount(type, userType);
    }

    /**
    * @Title: 根据不同状态查询评论的数量
    * @author 许振杰
    * @date 2022/1/17 0017 15:03
    * @version V1.0
    */
    @Override
    public Integer getCommentCountByStatus(Integer type, Integer userType, Integer status) {
        return commentMapper.getCommentCountByStatus(type, userType, status);
    }

    /**
    * @Title: 根据状态查询前端不同的评论
    * @author 许振杰
    * @date 2022/1/17 0017 15:04
    * @version V1.0
    */
    @Override
    public List<JsComment> getBeforeProductCommentByStatus(Integer type, Integer userType, Integer status) {
        return commentMapper.getBeforeProductCommentByStatus(type, userType, status);
    }

    /**
    * @Title: 根据状态查询后台不同的评论
    * @author 许振杰
    * @date 2022/1/17 0017 15:05
    * @version V1.0
    */
    @Override
    public List<JsComment> getUserProductCommentByStatus(Integer type, Integer userType, Integer status) {
        return commentMapper.getUserProductCommentByStatus(type, userType, status);
    }

    /**
    * @Title: 修改评论
    * @author Administrator
    * @date 2022/1/17 0017 16:13
    * @version V1.0
    */
    @Override
    public boolean editComment(Integer id, Integer status) {
        return commentMapper.editComment(id, status);
    }

    /**
    * @Title: 删除评论
    * @author 许振杰
    * @date 2022/1/17 0017 16:16
    * @version V1.0
    */
    @Override
    public boolean delComment(Integer id) {
        return commentMapper.delComment(id);
    }

    /**
    * @Title: 查询历史评论人数
    * @author 许振杰
    * @date 2022/1/17 0017 19:43
    * @version V1.0
    */
    @Override
    public Integer historyCommentPeople(Integer type, Integer userType) {
        return commentMapper.historyCommentPeople(type, userType);
    }

    /**
    * @Title: 查询评论的用户和时间
    * @author 许振杰
    * @date 2022/1/17 0017 19:44
    * @version V1.0
    */
    @Override
    public List<JsComment> getCommentUserAndData(Integer type, Integer userType) {
        return commentMapper.getCommentUserAndData(type, userType);
    }

    /**
    * @Title: 微圈前端全部评论
    * @author 许振杰
    * @date 2022/1/19 0019 15:41
    * @version V1.0
    */
    @Override
    public List<JsComment> getBeforeMicrocircleComment(Integer type, Integer userType) {
        return commentMapper.getBeforeMicrocircleComment(type, userType);
    }

    /**
    * @Title: 微圈后台全部评论
    * @author 许振杰
    * @date 2022/1/19 0019 15:41
    * @version V1.0
    */
    @Override
    public List<JsComment> getUserMicrocircleComment(Integer type, Integer userType) {
        return commentMapper.getUserMicrocircleComment(type, userType);
    }

    /**
    * @Title: 根据不同的状态查询前台微圈评论
    * @author 许振杰
    * @date 2022/1/19 0019 16:30
    * @version V1.0
    */
    @Override
    public List<JsComment> getBeforeMicrocircleCommentByStatus(Integer type, Integer userType, Integer status) {
        return commentMapper.getBeforeMicrocircleCommentByStatus(type, userType, status);
    }

    /**
    * @Title: 根据不同的状态查询后端微圈评论
    * @author 许振杰
    * @date 2022/1/19 0019 16:31
    * @version V1.0
    */
    @Override
    public List<JsComment> getUserMicrocircleCommentByStatus(Integer type, Integer userType, Integer status) {
        return commentMapper.getUserMicrocircleCommentByStatus(type, userType, status);
    }

    /**
    * @Title: 判断当前用户是前端用户还是后台用户
    * @author 许振杰
    * @date 2022/1/19 0019 20:15
    * @version V1.0
    */
    @Override
    public List<JsUser> getDeptId(Integer userId, String account) {
        return commentMapper.getDeptId(userId, account);
    }

    /**
    * @Title: 查询前端课程评论
    * @author 许振杰
    * @date 2022/1/20 0020 14:42
    * @version V1.0
    */
    @Override
    public List<JsComment> getBeforCourseComment(Integer type, Integer userType) {
        return commentMapper.getBeforCourseComment(type, userType);
    }

    /**
    * @Title: 查询后端课程评论
    * @author 许振杰
    * @date 2022/1/20 0020 14:43
    * @version V1.0
    */
    @Override
    public List<JsComment> getUserCourseComment(Integer type, Integer userType) {
        return commentMapper.getUserCourseComment(type, userType);
    }

    /**
    * @Title: 根部不同的状态查询前端评论
    * @author 许振杰
    * @date 2022/1/20 0020 14:43
    * @version V1.0
    */
    @Override
    public List<JsComment> getBeforCourseCommentByStatus(Integer type, Integer userType, Integer status) {
        return commentMapper.getBeforCourseCommentByStatus(type, userType, status);
    }

    /**
    * @Title: 根据不同的状态查询后端评论
    * @author 许振杰
    * @date 2022/1/20 0020 14:43
    * @version V1.0
    */
    @Override
    public List<JsComment> getUserCourseCommentByStatus(Integer type, Integer userType, Integer status) {
        return commentMapper.getUserCourseCommentByStatus(type, userType, status);
    }


    /**
    * @Title: 根据评论id查询微圈信息
    * @author 许振杰
    * @date 2022/1/21 0021 15:17
    * @version V1.0
    */
    @Override
    public JsMicrocircle getMicrocircleInformationById(Integer id) {
        return commentMapper.getMicrocircleInformationById(id);
    }

    /**
    * @Title: 根据评论id查询课程信息
    * @author 许振杰
    * @date 2022/1/21 0021 15:17
    * @version V1.0
    */
    @Override
    public JsCourse getCourseInformationById(Integer id) {
        return commentMapper.getCourseInformationById(id);
    }

    /**
    * @Title: 根据评论id查询商品信息
    * @author 许振杰
    * @date 2022/1/21 0021 15:18
    * @version V1.0
    */
    @Override
    public JsProduct getProductInformationById(Integer id) {
        return commentMapper.getProductInformationById(id);
    }

    /**
    * @Title: 个人课程前端评论
    * @author 许振杰
    * @date 2022/1/21 0021 21:10
    * @version V1.0
    */
    @Override
    public List<JsComment> getPersonalCourseBeforeComment(Integer type, Integer userType, Integer userId) {
        return commentMapper.getPersonalCourseBeforeComment(type, userType, userId);
    }

    /**
    * @Title: 个人课程后台评论
    * @author 许振杰
    * @date 2022/1/21 0021 21:10
    * @version V1.0
    */
    @Override
    public List<JsComment> getPersonalCourseUserComment(Integer type, Integer userType, Integer userId) {
        return commentMapper.getPersonalCourseUserComment(type, userType, userId);
    }

    /**
    * @Title: 查询个人不同状态下的前端课程评论
    * @author 许振杰
    * @date 2022/1/21 0021 21:10
    * @version V1.0
    */
    @Override
    public List<JsComment> getPersonalCourseBeforeCommentByStatus(Integer type, Integer userType, Integer userId, Integer status) {
        return commentMapper.getPersonalCourseBeforeCommentByStatus(type, userType, userId, status);
    }

    /**
    * @Title: 查询个人不同状态下的后端课程评论
    * @author 许振杰
    * @date 2022/1/21 0021 21:11
    * @version V1.0
    */
    @Override
    public List<JsComment> getPersonalCourseUserCommentByStatus(Integer type, Integer userType, Integer userId, Integer status) {
        return commentMapper.getPersonalCourseUserCommentByStatus(type, userType, userId, status);
    }

    /**
    * @Title: 查询个人不同商品的全部评论数量
    * @author 许振杰
    * @date 2022/1/22 0022 16:06
    * @version V1.0
    */
    @Override
    public Integer getPersonalCommentCount(Integer type, Integer userType, Integer userId) {
        return commentMapper.getPersonalCommentCount(type, userType, userId);
    }

    /**
    * @Title: 查询个人不同状态下的评论数量
    * @author 许振杰
    * @date 2022/1/22 0022 16:07
    * @version V1.0
    */
    @Override
    public Integer getPersonalCommentCountByStatus(JsComment comment) {
        return commentMapper.getPersonalCommentCountByStatus(comment);
    }

    /**
    * @Title: 个人历史评论人数
    * @author 许振杰
    * @date 2022/1/22 0022 16:46
    * @version V1.0
    */
    @Override
    public Integer personalHistoryComment(Integer userType, Integer type, Integer userId) {
        return commentMapper.personalHistoryComment(userType, type, userId);
    }

    /**
    * @Title: 个人前端微圈评论
    * @author 许振杰
    * @date 2022/1/22 0022 21:14
    * @version V1.0
    */
    @Override
    public List<JsComment> getPersonalBeforeMicrocircleComment(Integer type, Integer userType, Integer userId) {
        return commentMapper.getPersonalBeforeMicrocircleComment(type, userType, userId);
    }

    /**
    * @Title: 个人后端微圈评论
    * @author 许振杰
    * @date 2022/1/22 0022 21:15
    * @version V1.0
    */
    @Override
    public List<JsComment> getPersonalUserMicrocircleComment(Integer type, Integer userType, Integer userId) {
        return commentMapper.getPersonalUserMicrocircleComment(type, userType, userId);
    }

    /**
    * @Title: 根据不停状态查询个人前端微圈评论
    * @author 许振杰
    * @date 2022/1/22 0022 21:17
    * @version V1.0
    */
    @Override
    public List<JsComment> getPersonalBeforeMicrocircleCommentByStatus(Integer type, Integer userType, Integer userId, Integer status) {
        return commentMapper.getPersonalBeforeMicrocircleCommentByStatus(type, userType, userId, status);
    }

    /**
    * @Title: 根据不停状态查询个人后端微圈评论
    * @author 许振杰
    * @date 2022/1/22 0022 21:18
    * @version V1.0
    */
    @Override
    public List<JsComment> getPersonalUserMicrocircleCommentByStatus(Integer type, Integer userType, Integer userId, Integer status) {
        return commentMapper.getPersonalUserMicrocircleCommentByStatus(type, userType, userId, status);
    }

    /**
    * @Title: 个人前端商品评论
    * @author 许振杰
    * @date 2022/1/22 0022 22:24
    * @version V1.0
    */
    @Override
    public List<JsComment> getPersonalBeforeProductComment(Integer type, Integer userType, Integer userId) {
        return commentMapper.getPersonalBeforeProductComment(type, userType, userId);
    }

    /**
    * @Title: 个人后台商品评论
    * @author 许振杰
    * @date 2022/1/22 0022 22:24
    * @version V1.0
    */
    @Override
    public List<JsComment> getPersonalUserProductComment(Integer type, Integer userType, Integer userId) {
        return commentMapper.getPersonalUserProductComment(type, userType, userId);
    }

    /**
    * @Title: 根据不同的状态查询个人前端商品评论
    * @author 许振杰
    * @date 2022/1/22 0022 22:25
    * @version V1.0
    */
    @Override
    public List<JsComment> getPersonalBeforeProductCommentByStatus(Integer type, Integer userType, Integer userId, Integer status) {
        return commentMapper.getPersonalBeforeProductCommentByStatus(type, userType, userId, status);
    }

    /**
    * @Title: 根据不同的状态查询个人后端商品评论
    * @author 许振杰
    * @date 2022/1/22 0022 22:25
    * @version V1.0
    */
    @Override
    public List<JsComment> getPersonalUserProductCommentByStatus(Integer type, Integer userType, Integer userId, Integer status) {
        return commentMapper.getPersonalUserProductCommentByStatus(type, userType, userId, status);
    }
}
